package DAL.DTO;

import java.util.GregorianCalendar;

public class InterventionDTO {
        //Demande d’intervention
        private long idIntervention;
	private String statut;
        private ClientDTO client;
        private AdresseDTO adresse;
        private String descriptionDemande;
        private String prioriteDemande;
        private InterventionDTO parent;
	private GregorianCalendar dateDemande;
        private EmployeDTO employeDemande;
        //Planification d’une intervention
	private GregorianCalendar dateIntervention;
	private EmployeDTO technicien;
	private String prioriteIntervention;
	private EmployeDTO employePlanification;
        //Traitement d’une intervention
	private GregorianCalendar heureDebut;
	private GregorianCalendar heureFin;
	private InterventionDTO enfant;
	private EmployeDTO employeTraitement;

        //Constructeurs
        //Créer une intervention - Descendre une demande d'intervention
	public InterventionDTO( ClientDTO client, AdresseDTO adresse, 
				String descriptionDemande, String prioriteDemande,
                           	InterventionDTO parent, GregorianCalendar dateDemande,
				EmployeDTO employeDemande) {
		super();
		setStatut("Demandée");
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
	}

        //Remonter une demande d'intervention
	public InterventionDTO( long idIntervention, String statut, ClientDTO client,
                             	AdresseDTO adresse, String descriptionDemande, 
				String prioriteDemande, InterventionDTO parent, 
				GregorianCalendar dateDemande, EmployeDTO employeDemande) {
		super();
		setIdIntervention(idIntervention);
		setStatut(statut);
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
	}
        
        //Planifier une intervention - Descendre une intervention planifiée
	public InterventionDTO( long idIntervention, ClientDTO client,
                             	AdresseDTO adresse, String descriptionDemande, 
				String prioriteDemande, InterventionDTO parent, 
				GregorianCalendar dateDemande, EmployeDTO employeDemande,
				GregorianCalendar dateIntervention,
				EmployeDTO technicien, String prioriteIntervention,
				EmployeDTO employePlanification) {
		super();
		setIdIntervention(idIntervention);
		setStatut("Planifiée");
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(technicien);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
	}
        
        //Remonter une intervention planifiée
	public InterventionDTO(	long idIntervention, String statut, ClientDTO client,
                             	AdresseDTO adresse, String descriptionDemande, 
				String prioriteDemande, InterventionDTO parent, 
				GregorianCalendar dateDemande, EmployeDTO employeDemande,
				GregorianCalendar dateIntervention, EmployeDTO technicien,
				String prioriteIntervention, EmployeDTO employePlanification) {
		super();
		setIdIntervention(idIntervention);
		setStatut (statut);
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(technicien);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
        }
        
        //Déplanifier une intervention - descendre une intervention déplanifiée
	public InterventionDTO(	long idIntervention, ClientDTO client, AdresseDTO adresse, 
				String descriptionDemande, String prioriteDemande,
                           	InterventionDTO parent, GregorianCalendar dateDemande,
				EmployeDTO employeDemande, GregorianCalendar dateIntervention,
				String prioriteIntervention, EmployeDTO employePlanification) {
		super();
		setIdIntervention(idIntervention);
		setStatut("déplanifiée");
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(null);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
		setHeureDebut(heureDebut);
		setHeureFin(heureFin);
		setEnfant(enfant);
		setEmployeTraitement(employeTraitement);
        }
        
        //Remonter une intervention déplanifiée
	public InterventionDTO(	long idIntervention, String statut, ClientDTO client,
                             	AdresseDTO adresse, String descriptionDemande, 
				String prioriteDemande, InterventionDTO parent, 
				GregorianCalendar dateDemande, EmployeDTO employeDemande,
				GregorianCalendar dateIntervention, String prioriteIntervention,
				EmployeDTO employePlanification) {
		super();
		setIdIntervention(idIntervention);
		setStatut (statut);
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
        }
        
        //Reporter une intervention - descendre une intervention suivie
        //champ InterventionDTO enfant
	public InterventionDTO(	long idIntervention, ClientDTO client, AdresseDTO adresse, 
				String descriptionDemande, String prioriteDemande,
                           	InterventionDTO parent, GregorianCalendar dateDemande,
				EmployeDTO employeDemande, GregorianCalendar dateIntervention,
				EmployeDTO technicien, String prioriteIntervention,
				EmployeDTO employePlanification, GregorianCalendar heureDebut,
				GregorianCalendar heureFin, InterventionDTO enfant,
				EmployeDTO employeTraitement) {
		super();
		setIdIntervention(idIntervention);
		setStatut("Clôturée");
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(technicien);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
		setHeureDebut(heureDebut);
		setHeureFin(heureFin);
		setEnfant(enfant);
		setEmployeTraitement(employeTraitement);
        }
        
        //Remonter une intervention suivie
	public InterventionDTO(	long idIntervention, String statut, ClientDTO client,
                             	AdresseDTO adresse, String descriptionDemande, 
				String prioriteDemande, InterventionDTO parent, 
				GregorianCalendar dateDemande, EmployeDTO employeDemande,
				GregorianCalendar dateIntervention, EmployeDTO technicien,
				String prioriteIntervention, EmployeDTO employePlanification,
				GregorianCalendar heureDebut, GregorianCalendar heureFin,
				InterventionDTO enfant,	EmployeDTO employeTraitement) {
		super();
		setIdIntervention(idIntervention);
		setStatut(statut);
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(technicien);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
		setHeureDebut(heureDebut);
		setHeureFin(heureFin);
		setEnfant(enfant);
		setEmployeTraitement(employeTraitement);
        }
        
        //Clôturer une intervention - descendre une intervention clôturée
	public InterventionDTO(	long idIntervention, ClientDTO client, AdresseDTO adresse, 
				String descriptionDemande, String prioriteDemande,
                           	InterventionDTO parent, GregorianCalendar dateDemande,
				EmployeDTO employeDemande, GregorianCalendar dateIntervention,
				EmployeDTO technicien, String prioriteIntervention,
				EmployeDTO employePlanification, GregorianCalendar heureDebut,
				GregorianCalendar heureFin, EmployeDTO employeTraitement) {
		super();
		setIdIntervention(idIntervention);
		setStatut("Clôturée");
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(technicien);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
		setHeureDebut(heureDebut);
		setHeureFin(heureFin);
		setEmployeTraitement(employeTraitement);
        }
        
        //Remonter une intervention clôturée ou annulée
	public InterventionDTO(	long idIntervention, String statut, ClientDTO client,
                             	AdresseDTO adresse, String descriptionDemande, 
				String prioriteDemande, InterventionDTO parent, 
				GregorianCalendar dateDemande, EmployeDTO employeDemande,
				GregorianCalendar dateIntervention, EmployeDTO technicien,
				String prioriteIntervention, EmployeDTO employePlanification,
				GregorianCalendar heureDebut, GregorianCalendar heureFin,
				EmployeDTO employeTraitement) {
		super();
		setIdIntervention(idIntervention);
		setStatut(statut);
		setClient(client);
            	setAdresse(adresse);
		setDescriptionDemande(descriptionDemande);
            	setPrioriteDemande(prioriteDemande);
            	setParent(parent);
		setDateDemande(dateDemande);
		setEmployeDemande(employeDemande);
		setDateIntervention(dateIntervention);
		setTechnicien(technicien);
		setPrioriteIntervention(prioriteIntervention);
		setEmployePlanification(employePlanification);
		setHeureDebut(heureDebut);
		setHeureFin(heureFin);
		setEmployeTraitement(employeTraitement);
        }

	//Setters
        public void setIdIntervention(long idIntervention) {
		UTIL.Util.checkPositive(idIntervention);
                this.idIntervention = idIntervention;
	}
	
        public void setStatut(String statut) {
		UTIL.Util.checkString(statut);
                this.statut = statut;
	}

        public void setClient(ClientDTO client) {
		UTIL.Util.checkObject(client);
                this.client = client;
	}
	
        public void setAdresse(AdresseDTO adresse) {
		UTIL.Util.checkObject(adresse);
                this.adresse = adresse;
	}	

        public void setDescriptionDemande(String descriptionDemande) {
		UTIL.Util.checkString(descriptionDemande);
                this.descriptionDemande = descriptionDemande;
	}

        public void setPrioriteDemande(String prioriteDemande) {
		UTIL.Util.checkString(prioriteDemande);
                this.prioriteDemande = prioriteDemande;
	}

        public void setParent(InterventionDTO parent) {
		UTIL.Util.checkObject(parent);
                this.parent = parent;
	}

	public void setDateDemande(GregorianCalendar dateDemande) {
		this.dateDemande = dateDemande;
	}
	
       	public void setEmployeDemande(EmployeDTO employeDemande) {
		UTIL.Util.checkObject(employeDemande);
		this. employeDemande = employeDemande;
	}

	public void setDateIntervention(GregorianCalendar dateIntervention) {
		this.dateIntervention = dateIntervention;
	}

	public void setTechnicien(EmployeDTO technicien) {
	 	this.technicien = technicien;
	}

        public void setPrioriteIntervention(String prioriteIntervention) {
                UTIL.Util.checkString(prioriteIntervention);
                this.prioriteIntervention = prioriteIntervention;
        }
        
	public void setEmployePlanification(EmployeDTO employePlanification) {
		UTIL.Util.checkObject(employePlanification);
		this. employePlanification = employePlanification;
	}
            	
	public void setHeureDebut(GregorianCalendar heureDebut) {
		this.heureDebut = heureDebut;
	}

	public void setHeureFin(GregorianCalendar heureFin) {
		this.heureFin = heureFin;
	}

        public void setEnfant(InterventionDTO enfant) {
		UTIL.Util.checkObject(enfant);
                this.enfant = enfant;
	}

	public void setEmployeTraitement(EmployeDTO employeTraitement) {
		UTIL.Util.checkObject(employeTraitement);
		this. employeTraitement = employeTraitement;
	}

        //Getters 
        public long getIdIntervention() {
		return idIntervention;
	}
	
	public String getStatut() {
		return statut;
	}

        public ClientDTO getClient() {
		return client;
	}
	
        public AdresseDTO getAdresse() {
		return adresse;
	}	

        public String getDescriptionDemande() {
		return descriptionDemande;
	}

        public String getPrioriteDemande() {
		return prioriteDemande;
	}

        public InterventionDTO getParent() {
		return parent;
	}

      	public GregorianCalendar getDateDemande() {
		return dateDemande;
	}
	
  	public EmployeDTO getEmployeDemande() {
                return employeDemande;
	}

	public GregorianCalendar getDateIntervention() {
                return dateIntervention;
	}

	public EmployeDTO getTechnicien() {
                return technicien;
	}

        public String getPrioriteIntervention() {
            return prioriteIntervention;
        }
        
	public EmployeDTO getEmployePlanification() {
		return employePlanification;
	}
            	
	public GregorianCalendar getHeureDebut() {
		return heureDebut;
	}

        public GregorianCalendar getHeureFin() {
		return heureFin;
	}

        public InterventionDTO getEnfant() {
		return enfant;
	}

	public EmployeDTO getEmployeTraitement() {
		return employeTraitement;
	}
}